﻿package component.tree.sql;

import component.tree.model.TreeModel;
import component.tree.util.ConfigUtil;

public class TreeSqlFactory {
	private static ITreeSql instance = null;
	
	public static ITreeSql getInstance(){
		if(instance != null) return instance;
		
		String dbType = ConfigUtil.getDbType();

		return new CommonTreeSql();
	}
	
	public static String getTreeSql(TreeModel treeModel,boolean isQueryFirstLevel){
		return getInstance().getTreeSql(treeModel, isQueryFirstLevel);
	}
	
	public static String getChildSql(String parentId,TreeModel treeModel){
		return getInstance().getChildSql(parentId, treeModel);
	}
}
